数据库优化@ 内容 Tips 以前的内容 数据库包括: 1. 我也不知道 2. 我也不知道 3. 我也不知道 Tips Some tips can help with tuning tasks: Big non-transaction tables: create index with (AD_Org_ID, AD_Client_ID, IsActive) Big non-transaction tables: create index with (UPPER(Value)) Big non-transaction tables: create index with (UPPER(Name)) Big transaction tables: create index with (AD_Org_ID, AD_Client_ID, DocStatus, Processed, Posted) Separate index, data and blob tablespaces 以前的内容 数据库 --- 引用:[云栖社区digoal](https://yq.aliyun.com/users/1384833841157402?spm=5176.blog215.yqblogcon1.2.jL0rfH) https://yq.aliyun.com/articles/214?spm=5176.blog215.yqblogcon1.20.jL0rfH https://yq.aliyun.com/articles/215?spm=5176.blog214.yqblogcon1.18.B54DRu 1. 诊断角度 操作系统层面: 查看CPU, IO. 数据库层面: 查看pg_stat_statements Column |Type | Modifiers --------------------------------+----------------------------+------------ userid | oid | dbid | oid | query | text | calls | bigint | total_time | double precision | rows | bigint | shared_blks_hit | bigint | shared_blks_read | bigint | shared_blks_written | bigint | local_blks_hit | bigint | local_blks_read | bigint | local_blks_written | bigint | temp_blks_read | bigint | temp_blks_written | bigint | 其他pg_stat性能视图,日志中的long SQL。 2. 优化角度 参数, SQL, 架构, 连接池, 表空间拆分, 存储cache, 分表, 分库  数据查询 --- ####视图#### ####存储过程####